import request from '@/config/axios'


export const goodsCategoryApi = {
  // 更新商品分类
  updateGoodsCategory: async (data: any) => {
    return await request.put({ url: `/shops/goods-category/update`, data })
  },
  // 创建商品分类
  createGoodsCategory: async (data: any) => {
    return await request.post({ url: `/shops/goods-category/create`, data })
  },
  // 获取商品分类分页
  getGoodsCategoryPage: async (params: any) => {
    return await request.get({ url: `/shops/goods-category/getTree?shopId=` + params })
  },
  // 删除商品分类
  deleteGoodsCategory: async (id: number) => {
    return await request.delete({ url: `/shops/goods-category/delete?id=` + id })
  },
  // 获取商品类型模板
  getModeList: async () => {
    return await request.get({ url: `/shops/goods-category/getModeList` })
  }
}